package FirstChapter.three;

import API.Bag.Bag;
import API.Queue.Queue;
import API.Stack.StackByNode;


import java.util.Scanner;

/**
 * Created by Lee on 2017/2/16 0016.
 */
public class NodeStackQueueBagTest {
    public static void main(String[] args) {
        StackByNode<String> stack = new StackByNode<String>();
        Queue<String> queue = new Queue<String>();
        Bag<String> bag = new Bag<String>();
        Scanner scanner = new Scanner(System.in);
        while (true) {
            String s = scanner.next();
            if (s.equals("!")) {
                break;
            }
            stack.push(s);
            queue.enqueue(s);
            bag.add(s);
        }
        System.out.println("\n\n\nStack Start Now!");
        for (String s : stack) {
            System.out.println(s);
        }

        System.out.println("\n\n\nQueue Start Now!");
        for (String s : queue) {
            System.out.println(s);
        }

        System.out.println("\n\n\nBag Start Now!");
        for (String s : bag) {
            System.out.println(s);
        }

    }
}
